haptic5 2.2.0
Loading...
Searching...
No Matches
Haptic 5 Click Driver

API for configuring and manipulating Haptic 5 Click driver. More...

Topics

 Haptic 5 Registers List
 List of registers of Haptic 5 Click driver.
 Haptic 5 Settings
 Settings for configuration of Haptic 5 Click driver.
 Haptic 5 MikroBUS Map
 MikroBUS pin mapping of Haptic 5 Click driver.

Functions

void haptic5_cfg_setup (haptic5_cfg_t *cfg)
 Haptic 5 configuration object setup function.
err_t haptic5_init (haptic5_t *ctx, haptic5_cfg_t *cfg)
 Haptic 5 initialization function.
err_t haptic5_default_cfg (haptic5_t *ctx)
 Haptic 5 default configuration function.
err_t haptic5_set_duty_cycle (haptic5_t *ctx, float duty_cycle)
 Haptic 5 set duty cycle function.
err_t haptic5_pwm_stop (haptic5_t *ctx)
 Haptic 5 stop PWM function.
err_t haptic5_pwm_start (haptic5_t *ctx)
 Haptic 5 start PWM function.
void haptic5_set_dir_forward (haptic5_t *ctx)
 Haptic 5 set direction forward function.
void haptic5_set_dir_reverse (haptic5_t *ctx)
 Haptic 5 set direction reverse function.
void haptic5_toggle_dir (haptic5_t *ctx)
 Haptic 5 toggle direction function.
void haptic5_enable_device (haptic5_t *ctx)
 Haptic 5 enable device function.
void haptic5_disable_device (haptic5_t *ctx)
 Haptic 5 disable device function.

Detailed Description

API for configuring and manipulating Haptic 5 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ haptic5_cfg_setup()

void haptic5_cfg_setup ( haptic5_cfg_t * cfg)

Haptic 5 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See haptic5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ haptic5_default_cfg()

err_t haptic5_default_cfg ( haptic5_t * ctx)

Haptic 5 default configuration function.

This function executes a default configuration of Haptic 5 Click board.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ haptic5_disable_device()

void haptic5_disable_device ( haptic5_t * ctx)

Haptic 5 disable device function.

This function disables the device by setting the RST pin to LOW.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ haptic5_enable_device()

void haptic5_enable_device ( haptic5_t * ctx)

Haptic 5 enable device function.

This function enables the device by setting the RST pin to HIGH.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ haptic5_init()

err_t haptic5_init ( haptic5_t * ctx,
haptic5_cfg_t * cfg )

Haptic 5 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See haptic5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See haptic5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ haptic5_pwm_start()

err_t haptic5_pwm_start ( haptic5_t * ctx)

Haptic 5 start PWM function.

This function starts the PWM output.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ haptic5_pwm_stop()

err_t haptic5_pwm_stop ( haptic5_t * ctx)

Haptic 5 stop PWM function.

This function stops the PWM output.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ haptic5_set_dir_forward()

void haptic5_set_dir_forward ( haptic5_t * ctx)

Haptic 5 set direction forward function.

This function sets the motor direction to forward (DIR pin LOW).

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ haptic5_set_dir_reverse()

void haptic5_set_dir_reverse ( haptic5_t * ctx)

Haptic 5 set direction reverse function.

This function sets the motor direction to reverse (DIR pin HIGH).

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ haptic5_set_duty_cycle()

err_t haptic5_set_duty_cycle ( haptic5_t * ctx,
float duty_cycle )

Haptic 5 set duty cycle function.

This function sets the PWM duty cycle.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
[in]duty_cycle: PWM duty cycle value (0.0 to 1.0).
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ haptic5_toggle_dir()

void haptic5_toggle_dir ( haptic5_t * ctx)

Haptic 5 toggle direction function.

This function toggles the state of the DIR pin.

Parameters
[in]ctx: Click context object. See haptic5_t object definition for detailed explanation.
Returns
None.
Note
None.